package com.oppo.taunt;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

/**
 * @author steve
 * @since 2021-12-02 23:51
 */
public class TauntDialog extends DialogWrapper {

    private JLabel label;

    protected TauntDialog() {
        super(true);
        setTitle("每天一碗毒鸡汤");
        init();// 初始化
    }

    @Nullable
    @Override
    protected JComponent createCenterPanel() {
        JPanel panel = new JPanel();// 面板
        label = new JLabel(ContentUtil.getContent());
        panel.add(label);
        return panel;
    }

    @Override
    protected JComponent createSouthPanel() {
        JPanel southPanel = new JPanel(new FlowLayout());
        JButton button = new JButton("再干一碗");
        button.addActionListener(e ->{

            label.setText(ContentUtil.getContent());
        });
        southPanel.add(button);
        return southPanel;
    }


}
